<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <div>
        <button type="button" onclick="payPal()">支付</button>
    </div>

    <script src="/jquery.min.js"></script>
    <script>
        function payPal() {
            $.ajax({
                type : 'post',
                url : '/payPal',
                data : {},
                success : function(res) {
                    alert(res)
                    window.location.href = res;
                },
                error : function(res) {
                    alert("网络错误");
                }
            });
        }
    </script>

</body>
</html>